/**
 * 
 */
package edu.zut.hb.software.sample.base.domain;

import java.io.Serializable;
import java.util.List;

/**
 * @author Mie
 *
 */
public class BaseTreeEntity<T extends BaseTreeEntity<T,PK>,PK extends Serializable> extends BaseEntity<PK> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3531726741452520604L;
	/*
	 * children
	 */
	List<T> children;
	/*
	 * parent uncertain type,use T instead
	 */
	T parent;
	/*
	 * text
	 */
	String text;
	
	Boolean leaf;//标志位	
	
	public boolean isLeaf() {
		if (null != this.children && this.children.size() > 0) {
			this.leaf = false;
		} else {
			this.leaf = true;
		}
		return leaf;
	}
	public Boolean getLeaf() {
		return leaf;
	}
	public void setLeaf(Boolean leaf) {
		this.leaf = leaf;
	}
	
	public List<T> getChildren() {
		return children;
	}
	public void setChildren(List<T> children) {
		this.children = children;
	}
	public T getParent() {
		return parent;
	}
	public void setParent(T parent) {
		this.parent = parent;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	

}
